#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: title013.py 
@version:
@time: 2023/05/14
给定 n 个字符串，请对 n 个字符串按照字典序排列。
"""
while True:
    try:
        num = int(input())
        stack = []
        for i in range(num):
            stack.append(input())
        print("\n".join(sorted(stack)))
    except:
        break

"""
9
cap
to
cat
card
two
too
up
boat
boot
"""
